home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / c / RConfig.lha / RConfig_v1.1 / include / rsetjmp.h < prev   
Encoding:
C/C++ Source or Header  |  1992-09-13  |  1.1 KB  |  44 lines

  1. /*
  2.  * RConfig -- Replacement Library Configuration
  3.  *   Copyright 1992 by Anthon Pang, Omni Communications Products
  4.  *
  5.  * Source File: rsetjmp.h
  6.  * Description: longjmp(),setjmp() replacements
  7.  * Comments: replaces c.lib longjmp(),setjmp() which did not cooperate
  8.  *   nicely with dynastack & alloca()
  9.  */
  10.  
  11. #ifndef __RSETJMP_H
  12. #define __RSETJMP_H
  13.  
  14.     /*
  15.      * setjmp()/longjmp()
  16.      *
  17.      *   Set up for a non-local goto. (setjmp)
  18.      *   Execution of a non-local goto. (longjmp)
  19.      */
  20. #   ifdef __SETJMP_H
  21. #       undef __JBUFSIZE
  22. #       undef setjmp
  23. #       undef longjmp
  24. #   else
  25. #       define __SETJMP_H
  26. #   endif   /* __SETJMP_H */
  27.  
  28. #   define jmp_buf new_jmp_buf
  29.  
  30. #   if defined(__ALLOCA_REPLACE) && defined(__DYNASTACK_STKCHK)
  31. #       define __JBUFSIZE   (17*sizeof(char *))
  32. #   elif defined(__ALLOCA_REPLACE) || defined(__DYNASTACK_STKCHK)
  33. #       define __JBUFSIZE   (16*sizeof(char *))
  34. #   else
  35. #       define __JBUFSIZE   (15*sizeof(char *))
  36. #   endif
  37.  
  38.     typedef char new_jmp_buf[__JBUFSIZE];
  39.  
  40.     int setjmp(jmp_buf _env);
  41.     void longjmp(jmp_buf _env, int _val);
  42.  
  43. #endif  /* __RSETJMP_H */
  44.